package com.ruoyi.biz.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.biz.mapper.BizCourseCreditMapper;
import com.ruoyi.biz.domain.BizCourseCredit;
import com.ruoyi.biz.service.IBizCourseCreditService;
import com.ruoyi.common.core.text.Convert;

/**
 * 学分记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-09-01
 */
@Service
public class BizCourseCreditServiceImpl implements IBizCourseCreditService 
{
    @Autowired
    private BizCourseCreditMapper bizCourseCreditMapper;

    /**
     * 查询学分记录
     * 
     * @param id 学分记录ID
     * @return 学分记录
     */
    @Override
    public BizCourseCredit selectBizCourseCreditById(Integer id)
    {
        return bizCourseCreditMapper.selectBizCourseCreditById(id);
    }

    /**
     * 查询学分记录列表
     * 
     * @param bizCourseCredit 学分记录
     * @return 学分记录
     */
    @Override
    public List<BizCourseCredit> selectBizCourseCreditList(BizCourseCredit bizCourseCredit)
    {
        return bizCourseCreditMapper.selectBizCourseCreditList(bizCourseCredit);
    }

    /**
     * 新增学分记录
     * 
     * @param bizCourseCredit 学分记录
     * @return 结果
     */
    @Override
    public int insertBizCourseCredit(BizCourseCredit bizCourseCredit)
    {
        bizCourseCredit.setCreateTime(DateUtils.getNowDate());
        return bizCourseCreditMapper.insertBizCourseCredit(bizCourseCredit);
    }

    /**
     * 修改学分记录
     * 
     * @param bizCourseCredit 学分记录
     * @return 结果
     */
    @Override
    public int updateBizCourseCredit(BizCourseCredit bizCourseCredit)
    {
        bizCourseCredit.setUpdateTime(DateUtils.getNowDate());
        return bizCourseCreditMapper.updateBizCourseCredit(bizCourseCredit);
    }

    /**
     * 删除学分记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBizCourseCreditByIds(String ids)
    {
        return bizCourseCreditMapper.deleteBizCourseCreditByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除学分记录信息
     * 
     * @param id 学分记录ID
     * @return 结果
     */
    @Override
    public int deleteBizCourseCreditById(Integer id)
    {
        return bizCourseCreditMapper.deleteBizCourseCreditById(id);
    }
}
